﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using Cinemax.DTO;
namespace Cinemax.DAO
{
    public class LoaiVeDAO
    {
        static rapphimDataContext data = new rapphimDataContext();

        public static List<LoaiVeDTO> getAllLoaiVe()
        {
            List<LoaiVeDTO> dsLoaiVe = new List<LoaiVeDTO>();
            List<SP_GET_LOAIVEResult> dsLoaiVesp = new List<SP_GET_LOAIVEResult>();
            dsLoaiVesp = data.SP_GET_LOAIVE().ToList();
            foreach (SP_GET_LOAIVEResult item in dsLoaiVesp)
            {
                LoaiVeDTO lv = new LoaiVeDTO(item);
                dsLoaiVe.Add(lv);
            }
            return dsLoaiVe;
        }

        public static void updateLoaiVe(int maloaive, double giavemoi)
        {
            data.SP_UPDATE_LOAIVE(maloaive, giavemoi);
        }
    }
}